class ResearchsController < ApplicationController
	def index
    if params[:category_id]
      @category  = ResearchCategory.find_by_id(params[:category_id])
      @researchs = Research.paginate(:per_page => 10, :page => params[:page], :conditions => ["research_category_id=?", params[:category_id]], :order => "created_at DESC")
    else
		  @researchs = Research.paginate(:per_page => 10, :page => params[:page], :order => "created_at DESC")
    end
	end

	def show
		@research = Research.find_by_id(params[:id])
	end

end
